package com.hmall.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cons/")
@CrossOrigin(origins = "http://localhost:8088", maxAge = 3600)
@Api(value = "常量", description = "获取常量API")
public class ConstantController {


    public static String testOrderUrl = "http://47.98.169.251:9092";

    public static String testManageUrl = "http://47.98.169.251:9093";

    public static String testMallUrl = "http://47.98.169.251:9094";

    public static String indexUrl = "http://47.98.169.251:8081";

    public static String devOrderUrl = "http://47.98.171.71:9092";

    public static String devManageUrl = "http://47.98.171.71:9093";

    public static String devMallUrl = "http://47.98.171.71:9094";



    @GetMapping("getUrl")
    @ApiOperation(value = "获取各种资料的url", notes = "物流价格和物流公司价目表（图片）——logisImg  |" +
            " 物流价格和物流公司价目表（word）——logisWord )  |" + "企业营业执照模板（图片）——licenseImg  |" +
            "一般纳税人资质证书模板（图片）——taxCertImg  |" + "企业授权书模板已盖章（图片）——authImg  |" +
            "企业授权书模板未盖章模板（图片）——authNoImg  |" + "企业授权书未盖章模板（word）——authNoWord  |" +
            "自提委托书（图片）——selfProxyImg  |" + "用户注册协议（html）——regProtocol  |" + "月度订单计划评审(html) ——monthPlanReview"
    )
    public String getUrl(String type){

        String url = "";
        switch (type){
            case "logisImg" :{
                url = "http://huangyonghui.oss-cn-beijing.aliyuncs.com/imgupload/1529391426867.jpg?Expires=1844751425&OSSAccessKeyId=LTAIp8OhI23AvQo5&Signature=a1TVAEgFQmUY%2BAr7eED5qswnFsc%3D";
                break;
            }
            case "logisWord" :{
                url = "http://huangyonghui.oss-cn-beijing.aliyuncs.com/imgupload/1529390271095.docx?Expires=1844750269&OSSAccessKeyId=LTAIp8OhI23AvQo5&Signature=%2BXGRWndZaCXlpnvE1g8vk%2BPf2hk%3D";
                break;
            }
            case "licenseImg":{
                url = "http://huangyonghui.oss-cn-beijing.aliyuncs.com/imgupload/1528358449203.jpg?Expires=1843718440&OSSAccessKeyId=LTAIp8OhI23AvQo5&Signature=Tie4rRUFTnt0ypzcFaurOWdWHsM%3D";
                break;
            }
            case "taxCertImg":{
                url = "http://huangyonghui.oss-cn-beijing.aliyuncs.com/imgupload/1528358468934.png?Expires=1843718465&OSSAccessKeyId=LTAIp8OhI23AvQo5&Signature=B13KsvMegTfVA4tL1GQYK76wLpg%3D";
                break;
            }
            case "authImg":{
                url = "http://huangyonghui.oss-cn-beijing.aliyuncs.com/imgupload/1528341650432.png?Expires=1843701646&OSSAccessKeyId=LTAIp8OhI23AvQo5&Signature=I8m%2FxXHJ7VDi0PtlZvr5BFdODE0%3D";
                break;
            }
            case "authNoImg":{
                    url = "http://huangyonghui.oss-cn-beijing.aliyuncs.com/imgupload/1529035017219.png?Expires=1844395016&OSSAccessKeyId=LTAIp8OhI23AvQo5&Signature=44c4rxziK3AVW4IStHPUPfMlCVs%3D";
                break;
            }
            case "authNoWord":{
                url = "http://huangyonghui.oss-cn-beijing.aliyuncs.com/imgupload/1528341626566.docx?Expires=1843701621&OSSAccessKeyId=LTAIp8OhI23AvQo5&Signature=sZGt3sj6i4%2FOSfjdRz75vQzLDSc%3D";
                break;
            }

            case "selfProxyImg":{
                url = "http://huangyonghui.oss-cn-beijing.aliyuncs.com/imgupload/1529035085278.png?Expires=1844395080&OSSAccessKeyId=LTAIp8OhI23AvQo5&Signature=QDMO4pwGrBXtqRhFcvZMPfMJD5c%3D";
                break;
            }

            case "regProtocol":{
                url = "http://huangyonghui.oss-cn-beijing.aliyuncs.com/imgupload/1532508161309.html?Expires=1847868157&OSSAccessKeyId=LTAIp8OhI23AvQo5&Signature=k88gF2JEDqbYmG1LbjT4zQtxu7w%3D";
                break;
            }

            case "monthPlanReview":{
                url = "http://huangyonghui.oss-cn-beijing.aliyuncs.com/imgupload/1534240538403.html?Expires=1849600532&OSSAccessKeyId=LTAIp8OhI23AvQo5&Signature=Fo2TV6AIgtv6shsJMB7OaRuHCNY%3D";
                break;
            }
            default: url = "请输入正确的类型";
            break;

        }

      return url;
    }



}
